package socket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;

/**
 * @classname:Weather
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/21 17:19
 * @version: 0.1
 * @since:1.8
 */
public class Weather {
    public static void main(String[] args) {
        String path = "http://t.weather.itboy.net/api/weather/city/101010100";


        try (
                BufferedReader reader  = new BufferedReader(new InputStreamReader(new URL(path).openStream()))
                ){

            String result = "";
             result = reader.readLine();
            System.out.println(result);

        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
